# -*- coding: utf-8 -*-
# @Time    : 2021/3/30 21:13
# @Author  : lilu
# @Email   : 1906196327@qq.com
# @File    : 礼物交换.py
# @Software: PyCharm

import  random
#送礼物人的列表
number1 = ['张三','李四','王五','赵六']
#number2 = ['张三','李四','王五','赵六']
#收礼物人的列表
number2 = number1[:]
# k = 3
#
# for i in number1:
#     for j in number2:
#         #t1 = random.randint(0, l)
#         t2 = random.randint(0, len(number2)-1)
#         if i == number2[t2]:
#             continue
#         else:
#             print(f"{i}送给了{number2[t2]}")
#             number2.remove((number2[t2]))
#             # k -= 1
#             break

flag = 0
for i in number1:
    if i in number2:
        flag = 1
        number2.remove(i)
    t2 = random.randint(0,len(number2)-1)
    print(f"{i}送给了{number2[t2]}")
    number2.pop(t2)
    if flag == 1:
        number2.append(i)
